#ifndef CCANVAS_H
#define CCANVAS_H
#include <Windows.h>
#include "resource.h"
#include "CAbacus.h"
#define DIGITAL_INTERVAL 100
#define STONE_WIDTH 80
#define STONE_HEIGHT 40
#define FRAME_THICKNESS 40
#define BEAM_THICKNESS 40
#define STICK_DIAMETER 20
#define LEFT_X 50
#define TOP_Y 80
#define FONT_SIZE 40

class CCanvas
{
    public:
        CCanvas();
        HBRUSH lphbr[7];
        HFONT m_hFont;
        int iStoneType;
        void OnPaint(HWND hWnd, HDC hdc);
        void OnLeftButtonUp(int x, int y, HWND hWnd);
        void OnKeyUp(char cKeyCode, HWND hWnd);

    protected:
        CAbacus abacus;
        int frame_width, beam_top, down_frame_top, stick_top, stick_left, stick_height, up_stone_top, down_stone_top, stone_left, text_x, text_y;

    private:
        void DrawFramesAndBeam(HDC hdc);
        void DrawSticks(HDC hdc);
        void DrawEllipticStones(HDC hdc);
        void DrawHexagonalStones(HDC hdc);
        void DrawNumber(HDC hdc);
};

#endif // CCANVAS_H
